<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":"
            + request.getServerPort() + path + "/";
%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="zh-CN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<base href="<%=basePath%>">
 <link href="resources/css/bootstrap.min.css" rel="stylesheet">
    <script src="resources/js/jquery.min.js"></script>
    <script src="resources/js/bootstrap.min.js"></script>
    <script src="resources/js/base.js"></script>
    <title>C++轻松入门</title>
</head>
		<%@ include file="common/navbar.jsp"%>
	<c:if test="${not empty tip_error }"><strong>${tip_error }</strong></c:if>
  <form class="form-horizontal" action="student/login" method="post">
  <div class="form-group">
    <label class="col-sm-2 control-label">账号</label>
    <div class="col-sm-4">
      <input type="text" name="username"  class="form-control" placeholder="账号" required/><br>
    </div>
  </div>
  <div class="form-group">
    <label  class="col-sm-2 control-label">密码</label>
    <div class="col-sm-4">
     <input type="password" name="password" class="form-control" placeholder="密码" required/><br>
    </div>
  </div>
  <div class="form-group">
    <label  class="col-sm-2 control-label">账号类型</label>
    <div class="col-sm-4">
      <select id="select" onchange="changeAction()"  >
        <option value="student/login">学生</option>
        <option value="teacher/login">教师</option>
      </select>
        </div>
     </div>
  <div class="form-group">
    <div class="col-sm-offset-2 col-sm-10">
      <div class="checkbox">
        <label>
          <input type="checkbox"> Remember me
        </label>
      </div>
    </div>
  </div>
  <div class="form-group">
    <div class="col-sm-offset-2 col-sm-10">
      <button type="submit" class="btn btn-default">登陆</button>
    </div>
  </div>
</form>

<script type="text/javascript">
function changeAction(){
    //默认是login.action，当select改变时同时改变from的action属性
    //我这里直接把列表的value赋值到form的action，你可以根据需要改改
var selectValue=document.getElementById('select').value;
document.forms[0].action=selectValue;
}
</script>
</body>
</html>